//
//  PayTicketHeaderTableCell.m
//  didacar
//
//  Created by 度周末网络-王腾 on 15/12/23.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "PayTicketHeaderTableCell.h"

@implementation PayTicketHeaderTableCell

- (void)awakeFromNib {
    self.status.layer.cornerRadius = 2;
    self.status.layer.masksToBounds=YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}


-(void)showEntity:(PayTicketTypeEntity *)entity{
    if (entity == nil) {
        return;
    }
    self.startTime.text = entity.SendTime;
    
    [BaseTableViewCell setBusLineStartLocationString:entity.StartStation startStationType:entity.StartStationType label:self.startLocation];
 
    self.endLocation.text = entity.EndStation;
    
    self.price.attributedText = [CommoneTools getBusLinePriceString:entity.TicketPrice.stringValue isSale:entity.IsSale salePrice:entity.SalePrice.stringValue];
    
    self.kilometerTime.text = [NSString stringWithFormat:@"%@公里，约%@",entity.Mileage.stringValue,entity.UserTime];
    
}

-(void)setCellPayTicketStyle:(PayTicketStyle)payTicketStyle{
    switch (payTicketStyle) {
        case PayTicket_ThroughBus:
        {
            self.price.hidden = NO;
            self.status.hidden = NO;
//            self.status.text   = @"苏E-12345";
//            self.price.attributedText = [self getPrice:@"50" leftText:@"有票  " leftSymbol:@"¥"];
            
           
            self.status.hidden = YES;
            
        }
            break;
            
        default:
        {
            self.price.hidden  = YES;
            self.status.hidden = YES;
        }
            break;
    }
}

@end
